package Thread;

public class ThreadSleep2 {
    public static void main(String[] args) {
        Thread lin = new Thread(){
            public void run(){
                System.out.println("海帆:睡觉咯");
                try{
                    Thread.sleep(5000);
                }catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
                System.out.println("帅醒咯");
            }
        };

        Thread lin2 = new Thread(){
            public void run(){
                System.out.println("大哥，开始了");
                try{
                    System.out.println("来跟我唱");
                    Thread.sleep(500);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        };

        lin.start();
        lin2.start();
    }


}
